package com.hpeu_12.day1231;

public class PolymorphicdDemo02 {
	public static void main(String[] args) {
		Animal animal = new Cat();// 多态
		System.out.println(animal.num);
		animal.show();
		//animal.method();//这里会报错。因为父类中没有method()方法，它是子类特有的方法
	}
}

class Animal {
	static int num = 5;

	public static void show() {
		System.out.println("Animal show()");
	}

}

class Cat extends Animal {
	static int num = 6;

	public static void show() {
		System.out.println("Cat show()");
	}
	public void method() {
		System.out.println("cat method()");
	}

}